package com.scau.microblogverse.domain.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 系统操作日志表
 * </p>
 *
 * @author Starsky
 * @since 2025-10-27
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("app_log")
@ApiModel(value="AppLog对象", description="系统操作日志表")
public class AppLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "日志ID，主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "日志类型，如请求、错误")
    private String type;

    @ApiModelProperty(value = "用户ID")
    private Long userId;

    @ApiModelProperty(value = "请求开始时间")
    private LocalDateTime startTime;

    @ApiModelProperty(value = "耗时，毫秒")
    private Integer spendTimeMs;

    @ApiModelProperty(value = "请求URL")
    private String url;

    @ApiModelProperty(value = "请求方法GET/POST等")
    private String method;

    @ApiModelProperty(value = "用户IP地址")
    private String ip;

    @ApiModelProperty(value = "请求参数JSON")
    private String parameter;

    @ApiModelProperty(value = "响应结果")
    private String result;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime gmtCreate;

}
